package com.chenshu;

import com.chenshu.controller.UserController1;
import com.chenshu.controller.UserController2;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2024-03-31
 * Time：16:53
 */
public class Application {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean-scope.xml");
        //UserController1业务
        UserController1 userController1 = context.getBean("userController1", UserController1.class);
        userController1.doController();
        System.out.println("===========================");
        //UserController2业务
        UserController2 userController2 = context.getBean("userController2", UserController2.class);
        userController2.doController();
    }
}
